
<!DOCTYPE HTML>
<html lang="en">
<head>
    <link rel="stylesheet" href="__PUBLIC__/phone/css/styles.css" />
    
    <meta charset='UTF-8' />
<meta name='generator' content='ecos.b2c' />
<title>三鑫-灯世界网销平台</title>
<meta name='keywords' content='' />
<meta name='description' content='' />
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'/>
<link href="__PUBLIC__/phone/css/zhuce_style.css" rel="stylesheet" media="screen, projection" />
<script src="__PUBLIC__/phone/js/shop.min.js"></script>
</head>
<body>
<!--公共搜索栏-->
<include file="./phone/Home/View/Public/search.html"/>
    <div class="full-screen">
  <header>
    <div class="a-bar">
      <a href="javascript:history.back()" class="a-back"><i class="arr left"></i>返回</a>
      <div class="a-name">找回密码</div>
    </div>
  </header>
  <div class="full-padding">
      <form action="{:U('new_pwd')}" method="post" onsubmit="return send();" >
          <div class="" style="height: 40px;width: 90%;margin: 20px auto;">
            <input type="text" name="phone" id="phone" class="text" required="required" autofocus placeholder="输入手机号" data-caution="帐号不能为空"
                style="height:100%;width: 100%;padding-left: 10px;border: 1px solid #bfbfbf;border-radius: 5px;">
          </div>
          <div class="" style="height: 40px;width: 90%;margin: 20px auto;">
            <input type="text" name="code" id="code" class="text" required="required"  autofocus placeholder="输入验证码" data-caution="验证码不能为空"
                   style="height:100%;width: 60%;padding-left: 10px;border: 1px solid #bfbfbf;border-radius: 5px;">
            <button id="yzm" style="height:100%;width: 30%;border: 1px solid #bfbfbf;border-radius: 5px;float: right;background-color: #00a1f2;">获取验证码</button>
            <button id="no" style="display:none;height:100%;width: 30%;border: 1px solid #bfbfbf;border-radius: 5px;float: right;color: #bfbfbf">验证码已发送</button>
          </div>
          <div class="notice"></div>
          <div class="btn-bar">
            <button type="submit" class="btn"  style="border-radius: 5px;width: 90%;margin: 20px auto;height: 40px;">下一步</button>
          </div>
      </form>
  </div>
</div>
    <!--公共底部-->
    <include file="./phone/Home/View/Public/foot.html"/>

<script>
  //获取验证码
  $('#yzm').click(function () {
      var phone = $('#phone').val();
      if(phone == ''){
        alert('请填写手机号');
        return false;
      }

      $.ajax({
          url:"{:U('sendCode')}",
          type:'post',
          data:{'phone':phone,'type':'zhao'},
          success:function (e) {
              if(e == '成功'){
                  $('#yzm').css('display','none');
                  $('#no').css('display','block');
              }else{
                  alert(e);
              }
          }
      })
  })

  function send() {
      var phone = $('#phone').val();
      var code = $('#code').val();
      if(code == ''){
          alert('请填写验证码');
          return false;
      }
      if(phone == ''){
          alert('请填写手机号');
          return false;
      }
      var sub = '';
      $.ajax({
          url:"{:U('checkyzm')}",
          type:'post',
          data:{'phone':phone,'code':code},
          async: false,
          success:function (e) {
              if(e == 1){
                    return true;
              }else if(e == -1){
                  alert('验证码错误');
                  sub = 1;
              }else if(e == -2){
                  alert('手机格式不正确');
                  sub = 1;
              }
          }
      });
      if(sub == 1){
          return false;
      }

  }
  
</script>
</body>
</html>

